package com.zf.yichat.model;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

@Table(name = "st_user_ticket")
public class StUserTicket implements Serializable {

    // 官方邀请
    public static final String TYPE_OFFICIAL = "official";
    // 注册赠送
    public static final String TYPE_REGISTER = "register";


    // 未激活
    public static final Integer STATUS_ACTIVATION_NO = 0;
    // 已激活
    public static final Integer STATUS_ACTIVATION_YES = 1;


    @Id
    private Integer id;

    /**
     * 用户ID
     */
    @Column(name = "user_id")
    private Long userId;

    @Column(name = "ticket_code")
    private String ticketCode;

    @Column(name = "ticket_type")
    private String ticketType;

    /**
     * 0 未激活 1 已激活
     */
    private Integer status;

    // 激活人
    private String activationUser;
    // 备注
    private String remark;

    /**
     * 激活时间
     */
    @Column(name = "activation_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date activationTime;

    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private static final long serialVersionUID = 1L;

    public StUserTicket(Integer id, Long userId, String ticketCode, String ticketType, Integer status,String activationUser,String remark, Date activationTime, Date createTime) {
        this.id = id;
        this.userId = userId;
        this.ticketCode = ticketCode;
        this.ticketType = ticketType;
        this.status = status;
        this.activationUser = activationUser;
        this.remark = remark;
        this.activationTime = activationTime;
        this.createTime = createTime;
    }

    public StUserTicket() {
        super();
    }

    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取用户ID
     *
     * @return user_id - 用户ID
     */
    public Long getUserId() {
        return userId;
    }

    /**
     * 设置用户ID
     *
     * @param userId 用户ID
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

    /**
     * @return ticket_code
     */
    public String getTicketCode() {
        return ticketCode;
    }

    /**
     * @param ticketCode
     */
    public void setTicketCode(String ticketCode) {
        this.ticketCode = ticketCode == null ? null : ticketCode.trim();
    }

    /**
     * @return ticket_type
     */
    public String getTicketType() {
        return ticketType;
    }

    /**
     * @param ticketType
     */
    public void setTicketType(String ticketType) {
        this.ticketType = ticketType == null ? null : ticketType.trim();
    }

    /**
     * 获取0 未激活 1 已激活
     *
     * @return status - 0 未激活 1 已激活
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 设置0 未激活 1 已激活
     *
     * @param status 0 未激活 1 已激活
     */
    public void setStatus(Integer status) {
        this.status = status;
    }


    public String getActivationUser() {
        return activationUser;
    }

    public void setActivationUser(String activationUser) {
        this.activationUser = activationUser;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    /**
     * 获取激活时间
     *
     * @return activation_time - 激活时间
     */
    public Date getActivationTime() {
        return activationTime;
    }

    /**
     * 设置激活时间
     *
     * @param activationTime 激活时间
     */
    public void setActivationTime(Date activationTime) {
        this.activationTime = activationTime;
    }

    /**
     * @return create_time
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @param createTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}